package com.temp.dto;

import com.temp.enumeration.CampaignStatus;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.math.BigDecimal;

@Data
public class EditCampaignDTO {

    private Long id;

    @NotBlank(message = "apiMsg.titleNotNull")
    @Length(min = 10, max = 100, message = "apiMsg.titleLength,10~100")
    private String title;

    @NotNull(message = "apiMsg.targetAmountNotNull")
    @DecimalMin(value = "0.00", inclusive = false, message = "apiMsg.targetAmountMin,0.00")
    private BigDecimal goalAmount;

    @NotNull(message = "apiMsg.categoryNotNull")
    private Long categoryId;

    @NotBlank(message = "apiMsg.coverNotNull")
    private String coverImageUrl;

    private String anotherImgUrls;

    @NotBlank(message = "apiMsg.locationNotNull")
    @Pattern(
            regexp = "^[A-Za-z\\s\\-]+.\\s*[A-Za-z\\s\\-]+$",
            message = "apiMsg.patchLocation"
    )
    private String location;

    @NotBlank(message = "apiMsg.descriptionNotNull")
    @Length(min = 30, max = 150, message = "apiMsg.descriptionRange,30~150")
    private String description;

    @NotBlank(message = "apiMsg.contentNotNull")
    @Length(min = 50, message = "apiMsg.contentMin,50")
    private String context;

    @NotNull(message = "apiMsg.durationNotNull")
    @Min(value = 30, message = "apiMsg.durationMin,30")
    private int duration;

    @NotNull(message = "apiMsg.visibilityNotNull")
    private int visibility;

    @NotNull(message = "apiMsg.openMarketNotNull")
    private int openMarket;

    @NotNull(message = "apiMsg.statusNotNull")
    private CampaignStatus status;
}
